from flask import Flask
from flasgger import Swagger

# 接口文件导入
from src.api import api_bp
# 测试接口
from src.api_test import api_test_bp
def create_app():
     
    app = Flask(__name__,static_folder='../static')
    
    # api文档自动生成工具
    # from flasgger import Swagger
    # template = {
    #     "swagger": "2.0",
    #     "info": {
    #         "title": "收屋记AI API",
    #         "description": "收屋记AI API",
    #         "version": "0.0.1"
    #     },
    # }
    # Swagger(app,template=template)
    app.register_blueprint(api_bp)
    # 测试接口注册
    app.register_blueprint(api_test_bp)
    # 配置应用
    return app